home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / SCRNSAVE.H < prev    next >
C/C++ Source or Header  |  1993-11-23  |  7KB  |  169 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * scrnsave.h    Windows 3.1 screensaver defines and definitions.
  4. *                                                                             *
  5. *               Version 1.0                                                   *
  6. *                                                                             *
  7. *               NOTE: windows.h must be #included first                       *
  8. *                                                                             *
  9. *               Copyright (c) 1992, Microsoft Corp.  All rights reserved.     *
  10. *                                                                             *
  11. \*****************************************************************************/
  12.  
  13. #ifndef _INC_SCRNSAVE
  14. #define _INC_SCRNSAVE
  15.  
  16. #ifndef RC_INVOKED
  17. #pragma pack(1)         /* Assume byte packing throughout */
  18. #endif /* !RC_INVOKED */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {            /* Assume C declarations for C++ */
  22. #endif    /* __cplusplus */
  23.  
  24. #ifndef _INC_WINDOWS    /* If not included with 3.1 headers... */
  25. #define LPCSTR      LPSTR
  26. #define WINAPI      FAR PASCAL
  27. #define CALLBACK    FAR PASCAL
  28. #define UINT        WORD
  29. #define LPARAM      LONG
  30. #define WPARAM      WORD
  31. #define LRESULT     LONG
  32. #define HMODULE     HANDLE
  33. #define HINSTANCE   HANDLE
  34. #define HLOCAL      HANDLE
  35. #define HGLOBAL     HANDLE
  36. #endif  /* _INC_WINDOWS */
  37.  
  38.  
  39. /* Icon resource ID.
  40.  *
  41.  * This should be the first icon used and must have this resource number.
  42.  * This is needed as the first icon in the file will be grabbed
  43.  */
  44. #define ID_APP      100
  45. #define DLG_CHANGEPASSWORD      2000
  46. #define DLG_ENTERPASSWORD       2001
  47. #define DLG_INVALIDPASSWORD     2002
  48. #define DLG_SCRNSAVECONFIGURE   2003
  49.  
  50. #define idsIsPassword           1000
  51. #define idsIniFile              1001
  52. #define idsScreenSaver          1002
  53. #define idsPassword             1003
  54. #define idsDifferentPW          1004
  55. #define idsChangePW             1005
  56. #define idsBadOldPW             1006
  57. #define idsAppName              1007
  58. #define idsNoHelpMemory         1008
  59. #define idsHelpFile             1009
  60.  
  61. /* This function is the Window Procedure for the screen saver.  It is
  62.  * up to the programmer to handle any of the messages that wish to be
  63.  * interpretted.  Any unused messages are then passed back to
  64.  * DefScreenSaverProc if desired which will take default action on any
  65.  * unprocessed message...
  66.  */
  67. LRESULT WINAPI ScreenSaverProc(HWND, unsigned, UINT, LPARAM);
  68.  
  69. /* This function performs default message processing.  Currently handles
  70.  * the following messages:
  71.  *
  72.  * WM_SYSCOMMAND:   return FALSE if wParam is SC_SCREENSAVE or SC_CLOSE
  73.  *
  74.  * WM_DESTROY:      PostQuitMessage(0)
  75.  *
  76.  * WM_SETCURSOR:    By default, this will set the cursor to a null cursor,
  77.  *                  thereby removing it from the screen.
  78.  *
  79.  * WM_LBUTTONDOWN:
  80.  * WM_MBUTTONDOWN:
  81.  * WM_RBUTTONDOWN:
  82.  * WM_KEYDOWN:
  83.  * WM_KEYUP:
  84.  * WM_MOUSEMOVE:    By default, these will cause the program to terminate.
  85.  *                  Unless the password option is enabled.  In that case
  86.  *                  the DlgGetPassword() dialog box is brought up.
  87.  *
  88.  * WM_NCACTIVATE:
  89.  * WM_ACTIVATEAPP:
  90.  * WM_ACTIVATE:     By default, if the wParam parameter is FALSE (signifying
  91.  *                  that transfer is being taken away from the application),
  92.  *                  then the program will terminate.  Termination is
  93.  *                  accomplished by generating a WM_CLOSE message.  This way,
  94.  *                  if the user sets something up in the WM_CREATE, a
  95.  *                  WM_DESTROY will be generated and it can be destroyed
  96.  *                  properly.
  97.  *                  This message is ignored, however is the password option
  98.  *                  is enabled.
  99.  */
  100. LRESULT WINAPI DefScreenSaverProc(HWND, UINT, WPARAM, LPARAM);
  101.  
  102. /* A function is also needed for configuring the screen saver.  The function
  103.  * should be exactly like it is below and must be exported such that the
  104.  * program can use MAKEPROCINSTANCE on it and call up a dialog box. Further-
  105.  * more, the template used for the dialog must be called
  106.  * ScreenSaverConfigure to allow the main function to access it...
  107.  */
  108. BOOL    WINAPI ScreenSaverConfigureDialog(HWND, UINT, WPARAM, LPARAM);
  109.  
  110. /* This function is called from the ScreenSaveConfigureDialog() to change
  111.  * the Screen Saver's password.  Note:  passwords are GLOBAL to all
  112.  * screen savers using this model.  Whether or not the password is enabled
  113.  * is LOCAL to a particular screen saver.
  114.  */
  115. BOOL    WINAPI DlgChangePassword(HWND, UINT, WPARAM, LPARAM);
  116.  
  117. /* To allow the programmer the ability to register child control windows, this
  118.  * function is called prior to the creation of the dialog box.  Any
  119.  * registering that is required should be done here, or return TRUE if none
  120.  * is needed...
  121.  */
  122. BOOL    _cdecl RegisterDialogClasses(HINSTANCE);
  123.  
  124. /* The following three functions are called by DefScreenSaverProc and must
  125.  * be exported by all screensavers using this model.
  126.  */
  127. BOOL    WINAPI DlgGetPassword(HWND, UINT, WPARAM, LPARAM);
  128. BOOL    WINAPI DlgInvalidPassword(HWND, UINT, WPARAM, LPARAM);
  129. DWORD   WINAPI HelpMessageFilterHookFunction(int, WORD, LPMSG);
  130.  
  131. /*
  132.  * There are only three other points that should be of notice:
  133.  * 1) The screen saver must have a string declared as 'szAppName' contaning the
  134.  *     name of the screen saver, and it must be declared as a global.
  135.  * 2) The screen saver EXE file should be renamed to a file with a SCR
  136.  *     extension so that the screen saver dialog form the control panel can
  137.  *     find it when is searches for screen savers.
  138.  */
  139. #define WS_GT   (WS_GROUP | WS_TABSTOP)
  140. #define MAXFILELEN  13
  141. #define TITLEBARNAMELEN 40
  142. #define BUFFLEN    255
  143.  
  144. /* The following globals are defined in scrnsave.lib */
  145. extern HINSTANCE _cdecl hMainInstance;
  146. extern HWND _cdecl hMainWindow;
  147. extern char _cdecl szName[TITLEBARNAMELEN];
  148. extern char _cdecl szIsPassword[22];
  149. extern char _cdecl szIniFile[MAXFILELEN];
  150. extern char _cdecl szScreenSaver[22];
  151. extern char _cdecl szPassword[16];
  152. extern char _cdecl szDifferentPW[BUFFLEN];
  153. extern char _cdecl szChangePW[30];
  154. extern char _cdecl szBadOldPW[BUFFLEN];
  155. extern char _cdecl szHelpFile[MAXFILELEN];
  156. extern char _cdecl szNoHelpMemory[BUFFLEN];
  157. extern UINT _cdecl MyHelpMessage;
  158. extern HOOKPROC _cdecl fpMessageFilter;
  159.  
  160. #ifdef __cplusplus
  161. }
  162. #endif    /* __cplusplus */
  163.  
  164. #ifndef RC_INVOKED
  165. #pragma pack()
  166. #endif  /* !RC_INVOKED */
  167.  
  168. #endif  /* !_INC_SCRNSAVE */
  169.